//
//					Decoration.h
//

#ifndef __NEWA_DECORATION_H
#define __NEWA_DECORATION_H

namespace newa
{
	template < class Disposal = WinOwner, template < typename > WidgetT > 
	class SizeFrame : public ContainerWidget, public Disposal
	{
	public:
		typedef WidgetT< WinOwner > WidgetType;
	
		template < typename Manager >
		SizeFrame( const Manager& man )
		{
			Disposal::dispose( man );
			WidgetType * w = new WidgetType( *this );
			addWidget(w);
			
			m_welem = new WidgetElement<Disposal> ( man ); // This constructor calls dispose( man )  by itself
		}

		WidgetType * widget();
		
	private:
		
		WidgetElement< Disposal > * m_welem;
	
		void addWidget( Widget * w )
		{
			ContainerWidget::addWidget("widget", w);
		}
	};
}

#endif
